#import "ALTemplateSelectorFooterView.h"



#pragma mark Constants
static const CGFloat ALTemplateSelectorFooterCornerRadius = 5.0f;


#pragma mark -
#pragma mark Class Globals
NSColor *ALRoundedWhiteBackgroundColor;


#pragma mark -
@interface ALTemplateSelectorFooterView (ALRoundedWhiteViewPrivateMethods)

@end


#pragma mark -
@implementation ALTemplateSelectorFooterView


+(void)initialize {
	ALRoundedWhiteBackgroundColor = [NSColor colorWithCalibratedWhite:1.0f alpha:1.0f];
}

-(void)drawRect:(NSRect)dirtyRect {
	NSRect bounds = [self bounds];
	CGFloat minx = bounds.origin.x;
	CGFloat maxx = NSMaxX(bounds);
	CGFloat miny = bounds.origin.y;
	CGFloat maxy = NSMaxY(bounds);
	NSBezierPath *framePath = [NSBezierPath bezierPath];
	[framePath moveToPoint:NSMakePoint(minx, maxy)];
	[framePath lineToPoint:NSMakePoint(maxx, maxy)];
	[framePath lineToPoint:NSMakePoint(maxx, maxy - ALTemplateSelectorFooterCornerRadius)];
	[framePath appendBezierPathWithArcFromPoint:NSMakePoint(maxx, miny) toPoint:NSMakePoint(maxx - ALTemplateSelectorFooterCornerRadius, miny) radius:ALTemplateSelectorFooterCornerRadius];
	[framePath lineToPoint:NSMakePoint(minx + ALTemplateSelectorFooterCornerRadius, miny)];
	[framePath appendBezierPathWithArcFromPoint:bounds.origin toPoint:NSMakePoint(minx, miny + ALTemplateSelectorFooterCornerRadius) radius:ALTemplateSelectorFooterCornerRadius];
	[framePath closePath];
	[[NSColor whiteColor] setFill];
	[framePath fill];
}

@end
